package com.example.springbootgoods.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.springbootgoods.entity.Assess;
import com.example.springbootgoods.entity.Commodity;
import com.example.springbootgoods.mapper.AssessMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AssessService {
    @Autowired
    AssessMapper assessMapper;

    /**
     * 根据商品id查询评论
     * @param cid
     * @return
     */
    public List<Assess> selectById(int cid){
        QueryWrapper<Assess> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("cid",cid);
        List<Assess> list=assessMapper.selectList(queryWrapper);
        return list;
    }
}
